package com.tb.controller;


import com.tb.pojo.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/stu")
public class StudentController {


    @PostMapping("/register")
    public ModelAndView register(ModelAndView mav,
                                 Student student) {


        mav.setViewName("redirect:/root/student");
        return mav;
    }


    @GetMapping("/toRegister")
    public String toRegister() {

        return "/student/register";
    }


}
